﻿using System;
using BLWCMS.Core.Business;

namespace BLWCMS.Web.Modules
{
    public class LogoutModule:BaseModule
    {
        public LogoutModule() : base("/", true)
        {
            Post["/logout"] = p => LogOut();
        }

        private dynamic LogOut()
        {
            try
            {
                Session["loginedUser"] = null;
                return ResCode.N200("注销成功！", "/");
            }
            catch (Exception e)
            {
                return ResCode.N500("注销失败！");
            }
            
            
        }
    }
}